<?php /* Created on: 5/27/2010 */ ?>
<html>
<body>
<?php

include"connect_flag.php";
  /*$tablename = "country";
  $server = "sql.byethost27.org";
  $username = "rockedg1_rockedg";
  $password = "keelwater";
  $database = "rockedg1_country";
  
 
*/

$ip = $_SERVER['REMOTE_ADDR'];
 $ip_number = sprintf("%u", ip2long($ip));
	
	$country_query  = "SELECT * FROM $tablename WHERE IP_FROM <= $ip_number AND IP_TO >= $ip_number";
	$country_exec = mysql_query($country_query);
	 $ccode_array=mysql_fetch_array($country_exec);
	  $country_code=$ccode_array['COUNTRY_CODE2'];
	  $country_name=$ccode_array['COUNTRY_NAME'];
	  
	
mysql_close($con);
?>
</body>
</html>
